<?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가 

if (!$complete_url)
    $complete_url = "$g4[url]/plugin/cybercash/cash-charge-complete.php";

$cash_list[cl_payment] = sprintf("%d", $cash_list[cl_payment]);

$hashdata = md5($mw_cash[cf_lg_mid]."C".$cash_list[cl_id].$cash_list[cl_payment].$mw_cash[cf_lg_mertkey]); // hashdata 생성 - 결제요청무결성검증 

if (!$pay_name)
    $pay_name = $mw_cash['cf_cash_name'];
?>

<form name="mainForm" id="mainForm" method="POST" action="">

<!-- 결제를 위한 필수 hidden정보 -->
<input type="hidden" name="hashdata" value="<?=$hashdata?>"> <!-- 결제요청 검증(무결성) 필드-->
<input type="hidden" name="mid" value="<?=$mw_cash[cf_lg_mid]?>"> <!-- 상점ID -->
<input type="hidden" name="oid" value="C<?=$cl_id?>"> <!-- 주문번호 -->
<input type="hidden" name="pid" value="<?=get_session("pid")?>"> <!-- 주민등록번호 -->
<input type="hidden" name="amount" value="<?=$cash_list[cl_payment]?>"> <!-- 결제금액 -->
<input type="hidden" name="buyer" value="<?=$member[mb_name]?>"> <!-- 구매자 -->
<input type="hidden" name="productinfo" value="<?=$pay_name?>"> <!-- 상품명 -->
<!--<input type="hidden" name="pid" value="">--> <!-- 주민등록번호 -->

<!-- 팝업창 사용시 화면처리 URL (프레임 이용시 home_url 사용) -->
<input type="hidden" name="ret_url" value="<?=$complete_url?>"> 

<!-- 결제결과 DB처리 URL(웹전송연동방식일때 : 필수) -->
<input type="hidden" name="note_url" value="<?=$g4[url]?>/plugin/cybercash/pg.lgdacom.update.php"> 

<!-- 통계서비스를 위한 선택적인 hidden정보 -->
<input type="hidden" name="producttype" value="">
<input type="hidden" name="productcode" value="">
<input type="hidden" name="buyerid" value="<?=$member[mb_id]?>">
<input type="hidden" name="buyeremail" value="<?=$member[mb_email]?>">
<input type="hidden" name="deliveryinfo" value="">
<input type="hidden" name="receiver" value="">
<input type="hidden" name="receiverphone" value="<?=$member[mb_hp]?>">
<input type="hidden" name="disable_card" value="7A|6D|4J|4M|4V">

</form>

<? $is_test = false; ?>
<? //if ($is_admin) $is_test = true; ?>

<script type="text/javascript">
var type = "<?=$paytype?>";
function openWindow()
{
    $.post("<?=$g4[path]?>/pay.php", $("#mainForm").serialize());

    pg = window.open("about:blank","Window","width=330, height=430, status=yes, scrollbars=no,resizable=yes, menubar=no");

    if (type == "1") document.mainForm.action="http://pg.dacom.net/card/cardAuthAppInfo.jsp"; // 신용카드
    if (type == "2") document.mainForm.action="http://pg.dacom.net/transfer/transferSelectBank.jsp"; // 계좌이체
    if (type == "3") document.mainForm.action="http://pg.dacom.net/wireless/wirelessAuthAppInfo1.jsp"; // 휴대폰
    //if (type == "4") document.mainForm.action="http://pg.dacom.net/cas/casRequestSA.jsp"; // 가상계좌 

    <? if ($is_test) { ?>
    if (type == "1") document.mainForm.action="http://pg.dacom.net:7080/card/cardAuthAppInfo.jsp"; // 신용카드
    if (type == "2") document.mainForm.action="http://pg.dacom.net:7080/transfer/transferSelectBank.jsp"; // 계좌이체
    if (type == "3") document.mainForm.action="http://pg.dacom.net:7080/wireless/wirelessAuthAppInfo1.jsp"; // 휴대폰
    //if (type == "4") document.mainForm.action="http://pg.dacom.net:7080/cas/casRequestSA.jsp"; // 가상계좌 
    <? } ?>
 
    document.mainForm.target = "Window";
    document.mainForm.submit();

    pg.focus();
}
document.charset = 'euc-kr';
</script> 


